import 'static/js/common.js'
import './index.css'
import '../tpl/app/app'

$(function() {

  // 官网首页背景图变化
  headerBg();
  window.onresize = function() {
    headerBg();
  }
  $('#headerTab a').on('shown.bs.tab', function(e) {
    headerBg();
  })

  function headerBg() {
    if ($('#headerTab .active')[0].hash == '#hardware') {
      if ($(window).width() >= 768) {
        $('.website-header').css('background', '#000 url(/static/img/bg/hardware.jpg)no-repeat center/cover')
      } else {
        $('.website-header').css('background', '#000 url(/static/img/bg/hardware_mobile.jpg)no-repeat center bottom/contain')
      }
    } else {
      if ($(window).width() >= 768) {
        $('.website-header').css('background', '#000 url(/static/img/bg/bg_web.jpg)no-repeat center bottom/cover')
      } else {
        $('.website-header').css('background', '#000 url(/static/img/bg/bg_mobile.jpg)no-repeat center bottom/cover')
      }
    }
  }


  // chrome 扩展程序
  $('.install-chrome').on('click', function() {
    alert(i18n.install_extension_toast)
  })
})